from google.appengine.ext import db

class Artist(db.Model):
    """Models an Artist."""
    code = db.IntegerProperty()
    name = db.StringProperty()
    description = db.TextProperty()
    image = db.StringProperty()
    date = db.DateTimeProperty(auto_now_add=True)
    
    @staticmethod
    def get_by_code(artist_code):
        return Artist.gql("where code = :code", code = artist_code).get()
        
    